<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/25
 * Time: 11:54
 */

namespace app\common\model;


use think\Model;

class Article extends Model
{
    protected $pk = 'id';
    # 自动填写入时间戳
    protected $autoWriteTimestamp = true;

    # 开启自动设置
    protected $auto = []; // 无论是新增或更新都要设置的字段
    # 仅新增的有效
    protected $insert = ['create_time', 'status'=>1, 'is_top'=>0, 'is_hot'=>0];
    # 仅更新的时候设置
    protected $update = ['update_time'];
}